/**
 * @Author: 李文浩
 * @Date: 2019/8/15
 * @Last Modified by: 杨光宇
 * @Last Modified time: 2021-01-27 16:26:43
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 店端查询
export const selectMileageChange = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeMileage/selectMileageChange`, { params });

// 保存，编辑，新增里程修改 - 共用接口
export const applyMileageChange = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/changeMileage/applyMileageChange`, params);

// 查询所有工单
export const searchRepairOrder = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeMileage/searchRepairOrder`, { params });

// 厂端查询
export const selectMileageChangeFactory = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeMileage/selectMileageChangeFactory`, { params });

// 申请记录log
export const selectMileageChangeLog = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeMileage/selectMileageChangeLog`, { params });

// 审批 - 厂端 99931004通过 999310003驳回 99931005拒绝
export const mileageChangeAssessor = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/changeMileage/mileageChangeAssessor`, params);

// 查询所有人
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);

// 查询所有人
export const getAllUserByIds = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getNameByIds`, { params });

// 店端导出
export const dealerExportMileage = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeMileage/dealerExportMileage`, { params, responseType: 'arraybuffer' });
// 厂端导出
export const factoryExportMileage = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeMileage/factoryExportMileage`, { params, responseType: 'arraybuffer' });

//获取所有经销商
export const getAllDealer = params => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/dealerInfo/byAllTranslate`, { params });
